function checkData(type) {
    let element = document.getElementById(type);
    if (element === undefined) {
        return
    }
    let value = element.value;
    if (type === 'email') {
        let tips = element.parentElement.getElementsByTagName('span');
        if (value === undefined || value.trim() === '') {
            tips[0].innerText = '*' + ' 请输入邮箱';
        } else if (!(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/.test(value))) {
            tips[0].innerText = '*' + ' 邮箱格式不正确';
        } else {
            tips[0].innerText = '*';
        }
    }

    if (type === 'username') {
        let tips = element.parentElement.getElementsByTagName('span');
        if (value === undefined || value.trim() === '') {
            tips[0].innerText = '*' + ' 请输入用户名';
        } else {
            tips[0].innerText = '*';
        }
    }

    if (type === 'password') {
        let tips = element.parentElement.getElementsByTagName('span');
        if (value === undefined || value.trim() === '') {
            tips[0].innerText = '*' + ' 请输入密码';
        } else {
            tips[0].innerText = '*';
        }
    }

    if (type === 'enterpriseName') {
        let tips = element.parentElement.getElementsByTagName('span');
        if (value === undefined || value.trim() === '') {
            tips[0].innerText = '*' + ' 请输入企业名称';
        } else {
            tips[0].innerText = '*';
        }
    }

    if (type === 'whatsapp') {
        let tips = element.parentElement.getElementsByTagName('span');
        if (value === undefined || value.trim() === '') {
            tips[0].innerText = '*' + ' 请输入Whatsapp';
        } else {
            tips[0].innerText = '*';
        }
    }
}